/**
 * 由 CoCo 源代码计划解包器解包
 *
 * 模块 ID：1557
 */

"use strict"

var r = require("../1698/86/index")
var o = require("../1541/167")
var i = require("../1541/819")
var a = require("../1541/231")
var s = require("../1541/309")
var c = require("../1684/257")
var l = require("./707")
var u = require("./821/index")
var d = require("./822")
var p = require("../1541/247/index")
var f = require("./629/index")
var h = p("isConcatSpreadable")
var m = f >= 51 || !o(function () {
  var e = []
  e[h] = false
  return e.concat()[0] !== e
})
var g = d("concat")
var _ = function (e) {
  if (!a(e)) {
    return false
  }
  var t = e[h]
  return undefined !== t ? !!t : i(e)
}
r({
  target: "Array",
  proto: true,
  forced: !m || !g
}, {
  concat: function (e) {
    var t
    var n
    var /* [auto-meaningful-name] */arguments$length
    var o
    var i
    var a = s(this)
    var d = u(a, 0)
    var p = 0
    for (t = -1, arguments$length = arguments.length; t < arguments$length; t++) {
      if (_(i = -1 === t ? a : arguments[t])) {
        if (p + (o = c(i.length)) > 9007199254740991) {
          throw TypeError("Maximum allowed index exceeded")
        }
        for (n = 0; n < o; n++, p++) {
          if (n in i) {
            l(d, p, i[n])
          }
        }
      } else {
        if (p >= 9007199254740991) {
          throw TypeError("Maximum allowed index exceeded")
        }
        l(d, p++, i)
      }
    }
    d.length = p
    return d
  }
})
